﻿using FarmSmartSleep.Common.Dtos;
using FarmSmartSleep.Organ.API.Application.PromptReportCommands;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace FarmSmartSleep.Organ.API.Controllers
{
    /// <summary>
    /// 提示报表
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class PromptReportController : ControllerBase
    {
        private readonly IMediator mediator;

        public PromptReportController(IMediator mediator)
        {
            this.mediator = mediator;
        }


        /// <summary>
        /// 待配提示显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet("PendingSelect")]
        public async Task<Result> Handle()
        {
            return await mediator.Send(new PendingSelectCommand());
        }


        /// <summary>
        /// 首次妊检提示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost("FirstPregnancySelect")]
        public async Task<Result> Handle(FirstPregnancySelectCommand request)
        {
            return await mediator.Send(request);
        }


        /// <summary>
        /// 分娩提示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>

        [HttpPost("ChildbirthTipsSelect")]
        public async Task<Result> Handle(ChildbirthTipsSelectCommand request)
        {
            return await mediator.Send(request);
        }
    }

}
